package com.xinghou.platform.dao.main;

import com.xinghou.platform.entity.req.ListReq;
import com.xinghou.platform.model.main.Notice;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("NoticeDAO")
public interface NoticeDAO {



	 public Notice getNoticeById(Integer Id)throws DataAccessException;
	 
	 public int updateNotice(Notice notice) throws DataAccessException;

	 public void deleteNotice(String jpushid) throws DataAccessException;
		
	 public int saveNotice(Notice notice) throws DataAccessException;
	 
	 /**
	  * 得到通知消息列表
	  * @param sendid		sendid 为空null
	  * @param receiverid   receiverid
	  * @param state		消息状态 0未读 1已读
	  * @param startNum		分页起始索引
	  * @param limitNum		条数
	  * @return
	  * @throws DataAccessException
	  */
	 public List<Notice> getNoticeList(Integer sendid,Integer receiverid,Integer state,int startNum,int limitNum) throws DataAccessException;
	 
	 /**
	  * 得到消息数量
	  * @param sendid 		sendid 为空null
	  * @param receiverid	receiverid (不能为空)
	  * @param state		消息状态 0未读 1已读
	  * @return
	  * @throws DataAccessException
	  */
	 public int queryMessageCount(Integer sendid,Integer receiverid,int state) throws DataAccessException;
	 
	 public Notice getNoticeByTitle(String title,Integer userId) throws DataAccessException;
	public List<Notice> list(ListReq listReq) throws DataAccessException;
}
